package com.coderman.basketball.statistics.controller;

import com.coderman.basketball.statistics.dto.GameEventDTO;
import com.coderman.basketball.statistics.service.GameEventService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Description:
 * date: 2021/4/22
 *
 * @author shenshuai
 * @version 1.0.0
 * @since JDK 1.8
 * 事件接收服务
 * 比赛活动数据写服务
 */
@RestController
@Slf4j
public  class EventReceiveController {

    @Autowired
    private GameEventService gameEventService;
    /**
     * 接收球场设备返回的数据信息
     * @param gameEventDTO
     * @return
     */
    @RequestMapping(value = "/receive/message")
    public String receiveMessage(GameEventDTO gameEventDTO){
        log.info("gameEventDTO={}",gameEventDTO.toString());
        gameEventService.dealEvent(gameEventDTO);
        return "";
    }
}
